@tool
extends Camera2D

@export var width_px: int = 1152 * 2 : set = set_width
@export var height_px: int = 648 * 2 : set = set_height
@export var border_color: Color = Color(0.384, 0.509, 0.891, 0.85) : set = set_border_color
@export var border_width: float = -1.0 : set = set_border_width

func _ready() -> void:
	queue_redraw()

func _draw() -> void:
	var rect := Rect2(Vector2(0, 0), Vector2(width_px, height_px))
	draw_rect(rect, border_color, false, border_width)

func set_width(v: int) -> void:
	if width_px == v:
		return
	width_px = v
	queue_redraw()

func set_height(v: int) -> void:
	if height_px == v:
		return
	height_px = v
	queue_redraw()

func set_border_color(c: Color) -> void:
	border_color = c
	queue_redraw()

func set_border_width(w: float) -> void:
	if border_width == w:
		return
	border_width = w
	queue_redraw()
